package com.ton;

import com.ton.common.controller.task.PayOrderPayingTask;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableScheduling //开始定时任务
public class Application implements ApplicationListener<ContextRefreshedEvent> {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
        System.out.println("http://localhost:9021/api/doc.html#/home");
    }

    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        new PayOrderPayingTask().init().start();
    }
}
